package com.sgcc.fj.pmos.e_fj_mall.presenter;

import com.sgcc.fj.pmos.common.base.BasePresenter;
import com.sgcc.fj.pmos.common.bean.RatioCurveBean;
import com.sgcc.fj.pmos.common.http.HttpInterConst;
import com.sgcc.fj.pmos.common.http.HttpRequestUtils;
import com.sgcc.fj.pmos.common.http.MvcNetCallback;
import com.sgcc.fj.pmos.e_fj_mall.contract.PowSetByChartContract;

import java.util.ArrayList;
import java.util.HashMap;

public class PowSetByChartPresenter extends BasePresenter<PowSetByChartContract.View> implements PowSetByChartContract.Presenter {

    private ArrayList<RatioCurveBean.Bean> ratioCurveList;


    @Override
    public void getChartList() {

        HttpRequestUtils.getInstance().request(new HashMap<>(), HttpInterConst.GET_RATIO_CURVE, new MvcNetCallback<RatioCurveBean>() {
            @Override
            public void onResponse(RatioCurveBean response, int id) {
                super.onResponse(response, id);
                if (null != response) {
                    ratioCurveList = response.getData();
                    if (null != ratioCurveList && ratioCurveList.size() > 0) {
                        RatioCurveBean.Bean bean = ratioCurveList.get(0);
                        getView().getChartListSuccess(ratioCurveList);
                    }
                }
            }
        });
    }

    ;
}
